/*
 * Image.h
 *
 *  Created on: 29 mar 2010
 *      Author: hule
 */

#ifndef IMAGE_H_
#define IMAGE_H_

#include <string>
#include <SDL/SDL_opengl.h>

using namespace std;

class SDL_Surface;
class SpriteAnimation;

class Image {
public:
	Image(string file);
	virtual ~Image();

	void draw(SpriteAnimation *animation = NULL);
	void loadImage(string file);


	string getFileName();
	SDL_Surface *getSurface();
	int getWidth();
	int getHeight();
	GLuint getTexture();

	void moveTo(int x, int y);
	void moveTo(float x, float y);
	void rotate(double da);
	float getXpos() { return xpos; }
	float getYpos() { return ypos; }
	void setAngle(float a) { angle = a; }
	float getAngle() { return angle; }
	void setFixedToScr(bool f) { fixedToScr = f; }
	void setScaleX(float x) { scaleX = x; }
	void setScaleY(float y) { scaleY = y; }

protected:
	string file;
	SDL_Surface *surface;
	int width;
	int height;
	GLuint texture;

	float xpos;
	float ypos;
	float angle;
	float scaleX, scaleY;
	bool fixedToScr;

};

#endif /* IMAGE_H_ */
